package Homework;

import collection.Point;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class contains {
    public static void main(String[] args) {
        Collection c = new ArrayList();
        c.add(new Point(1,2));
        c.add(new Point(3,4));
        c.add(new Point(5,6));
        boolean b = c.add(new Point(7,8));
        System.out.println(b);
        Point p = new Point(9,10);
        boolean contains = c.contains(p);
        System.out.println("是否包含"+contains);

        boolean remove = c.remove(p);
        System.out.println("是否删除"+remove);
        System.out.println(c);

        Collection c2 = new ArrayList();
        Point p1 =new Point(11,12);
        c.add(p1);
        System.out.println(c);
        System.out.println(p);


        p.setX(11);
        System.out.println(p);
        System.out.println(c);

        List<Integer> points = new ArrayList<>();
        for (int i = 0; i < 10; i++){
            points.add(i*2);
        }
        System.out.println(points);
        List<Integer> subList = points.subList(2, 6);
        System.out.println(subList);




































































    }

}
